﻿using System;
using System.Diagnostics.Contracts;

namespace Cloak.Mvvm.Navigation
{
	/// <summary>
	/// Describes a context in which navigation occurs
	/// </summary>
	[ContractClass(typeof(INavigationContextContract))]
	public interface INavigationContext
	{
		/// <summary>
		/// Navigates this context to the resource represented by the specified URI
		/// </summary>
		/// <param name="pageUri">The URI of the resource to load in this context</param>
		void Navigate(Uri pageUri);
	}

	[ContractClassFor(typeof(INavigationContext))]
	internal abstract class INavigationContextContract : INavigationContext
	{
		void INavigationContext.Navigate(Uri pageUri)
		{
			Contract.Requires(pageUri != null);
		}
	}
}